package user_api

import (
	"AccessAdmin/internal/dao"
	"AccessAdmin/internal/model/entity"
	"AccessAdmin/internal/service"
	"context"
)

type sUserApi struct {
}

func init() {
	service.RegisterUserApi(New())
}

func New() *sUserApi {
	return &sUserApi{}
}

// Info 获取用户信息
func (s *sUserApi) Info(ctx context.Context, UserId uint) (*entity.UserApi, error) {
	out := &entity.UserApi{}
	err := dao.UserApi.Ctx(ctx).Where(dao.UserApi.Columns().Id, UserId).Scan(out)
	if err != nil {
		return nil, err
	}
	return out, nil
}
